#include <stdlib.h>
#include "my_thread.h"

#define handle_error(msg) do { perror(msg); exit(EXIT_FAILURE); } while (0)

	
typedef struct thread * thread_t;
thread_t current;
thread_t th;

void** retval;

void* fct(void* param){
		return param;
}

int main(int argc, char * argv[]){
	
	int a = thread_create(current, fct, param);
	if (a == -1) handle_error("thread_create");
	else {
		thread_join(th, retval); // suspend l'exécution du thread courant "current" jusqu'à ce que le thread "th" achève son exécution.
		printf("thread exited");					
		}

}
